package comm.test.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author WangLin
 * @packageName
 * @ClassName Company
 * @date 2020/11/10 9:17
 * @description
 */
@Component("company")
@Scope("prototype")
public class Company {

    @Autowired
    @Qualifier("testEngineer")

//    @Resource(name = "softwareEngineer")
    Engineer engineer;

    public Company() {
        System.out.println("Company--------------------");
    }

    public Company(Engineer engineer) {
        this.engineer = engineer;
    }

    //    public void run(String... str) {
    public void run(String str, String name) {
        System.out.println("run 开始执行。。");

        engineer.work();

        System.out.println("run 执行完成。。");

    }

    public Engineer getEngineer() {
        return engineer;
    }

    public void setEngineer(Engineer engineer) {
        this.engineer = engineer;
    }
}
